package com.yzp.controller;

import com.yzp.master.dao.StudentDao;
import com.yzp.service.CurdService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Description
 *
 * @className: JpaAtomikosController
 * @author: yanzhouping
 * @date: 2019/9/18 10:55
 */
@RestController
public class JpaAtomikosController {
    @Autowired
    private CurdService curdService;

    @Autowired
    private StudentDao studentDao;

    @RequestMapping("/add")
    public void add() {
        curdService.add(1);
    }

    @RequestMapping("/test")
    public void test() {
        curdService.add(0);
    }

    @RequestMapping("/list")
    public void list() {
        System.out.println(studentDao.findAll());

    }
}
